package support;

import java.awt.Point;

public class Reta {
    
    private Ponto ponto     = new Ponto();
    private Ponto direction = new Ponto();
    
    public Reta(){
        this.ponto.set_x(0);
        this.ponto.set_y(0);
        this.direction.set_x(0);
        this.direction.set_y(0);
    }
    
    public void set_ponto( double x, double y ){
        this.ponto.set_x( x );
        this.ponto.set_y( y );
    }
    
    public void set_direction( double x, double y ){
        this.direction.set_x(x);
        this.direction.set_y(y);
    }
    
    public void set_direction( double degree ){
        this.direction.set_x( this.ponto.get_x() + Math.cos(Math.toRadians(90 - degree)) );
        this.direction.set_y( this.ponto.get_y() + Math.sin(Math.toRadians(90 - degree)) );
    }
    
    public Ponto get_ponto()    { return this.ponto; }
    public Ponto get_direction(){ return this.direction; }
    
}
